package org.jeecg.modules.recruit.appuser.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.recruit.appuser.entity.MmAppUser;
import org.jeecg.modules.recruit.appuser.entity.MmAppUserAuth;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: app用户信息
 * @Author: jeecg-boot
 * @Date:   2020-08-27
 * @Version: V1.0
 */
public interface IMmAppUserService extends IService<MmAppUser> {

    /**
     * 添加一对多
     */
    public void saveMain(MmAppUser mmAppUser, List<MmAppUserAuth> mmAppUserAuthList);

    /**
     * 修改一对多
     */
    public void updateMain(MmAppUser mmAppUser, List<MmAppUserAuth> mmAppUserAuthList);

    /**
     * 删除一对多
     */
    public void delMain(String id);

    /**
     * 批量删除一对多
     */
    public void delBatchMain(Collection<? extends Serializable> idList);

    /**
     * 减掉用户金额
     *
     * @param userId 用户id
     * @param amount 扣减金额
     * @return
     */
    boolean minusAmount(String userId, Integer amount);

    /**
     * 用户注册
     *
     * @param mmAppUser    用户对象
     * @param popularizeId 推广员id
     * @return
     */
    MmAppUser register(MmAppUser mmAppUser, String popularizeId);

}
